package com.baichang.taoshunda.entity.em;

/**
 * 用户身份
 * Created by Dylan on 2015/12/9.
 */
public enum UserType {
    用户("0"), 商家("1");

    private String code;

    private UserType() {

    }

    private UserType(String code) {
        this.code = code;
    }

    public static UserType valueOfCode(String code) {
        UserType[] states = UserType.values();
        for (UserType state : states) {
            if (state.getCode().equals(code)) {
                return state;
            }
        }
        return null;
    }

    public String getCode() {
        return this.code;
    }

    @Override
    public String toString() {
        return String.valueOf(this.code);
    }

}
